<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>
<script type="text/javascript">
    function onTabClick(tabId) {
        switch (tabId) {
            case "BaseInfo" :
                $("#BaseInfo").addClass("tabOn");
                $("#VideoList").removeClass("tabOn");
                $("#divBaseInfo").css("display", "block");
                $("#divVideoList").css("display", "none");
                break;
            case "VideoList":
                $("#BaseInfo").removeClass("tabOn");
                $("#VideoList").addClass("tabOn");
                $("#divBaseInfo").css("display", "none");
                $("#divVideoList").css("display", "block");
                break;
        }
    }
</script>
<div class="sf_admin_form">
    <?php echo form_tag_for($form, '@reader_survey') ?>
    <?php echo $form->renderHiddenFields(false) ?>

    <?php if ($form->hasGlobalErrors()): ?>
    <?php echo $form->renderGlobalErrors() ?>
    <?php endif; ?>

    <tr height="25px">
        <td style="padding-left:10px">
            <table style="height: 22px;" cellSpacing="0" cellPadding="0" border="0">
                <tr valign="bottom">
                    <td vAlign="bottom" style="FONT-SIZE: 9pt">
                        <span class="tab tabOn" tabIndex="0" id="BaseInfo" tabID="tab0"
                              onclick="onTabClick('BaseInfo')">基本信息</span>
                        <span class="tab" tabIndex="1" tabID="tab2" id="VideoList"
                              onclick="onTabClick('VideoList')">调查反馈</span></td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="padding-left:5px">

            <!--            读者调查基本信息-->
            <div class="tab" id="divBaseInfo">
                <?php foreach ($configuration->getFormFields($form, $form->isNew() ? 'new'
                                                                          : 'edit') as $fieldset => $fields): ?>
                <?php include_partial('readerSurvey/form_fieldset', array('reader_survey' => $reader_survey, 'form' => $form, 'fields' => $fields, 'fieldset' => $fieldset)) ?>
                <?php endforeach; ?>
            </div>

            <div class="tab" id="divVideoList" style="display:none;">
                <?php include_component('readerSurvey', 'surveyReport', array('survey_id' => $reader_survey->getId())) ?>
            </div>
        </td>
    </tr>

    <?php include_partial('readerSurvey/form_actions', array('reader_survey' => $reader_survey, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?>
    </form>
</div>
